package com.hui.dao;

import com.hui.entiry.Article;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

/**
 * Created with IntelliJ IDEA.
 *
 * @Auther: 李昭辉
 * @Date: 2021/07/30/20:32
 * @Description:
 */
@Repository("articleDao")
public class ArticleDaoImpl implements ArticleDao {
    @Autowired
    private JdbcTemplate jdbcTemplate;

    // 添加文章操作
    @Override
    public void insertArticle(Article article) {
        String sql = "insert into t_article (title,content) values(?,?)";
        jdbcTemplate.update(sql, article.getTitle(), article.getContent());
    }
}
